#ifndef __DEFINES_H
#define __DEFINES_H

// Debugging.
#define DEBUG_ENABLED
#define DEB_OUT(message) 				System.out.println(message);
#define DEB_ERR(error) 					System.err.println(error);

// Menus.
#define MAX_TEAMS_ON_SCREEN 			(5)
#define MENU_WIDTH_RATIO  				(60 / 100)
#define MENU_HEIGHT_RATIO  				(10 / 100)

// States.
#define HAS_TEAM_SELECTION
//#define HAS_SET_KEYS
//#define HAS_INTRO

// Screen
#ifdef SCREEN_WIDTH
	#undef SCREEN_WIDTH
	#undef SCREEN_HEIGHT
#endif

#define SCREEN_WIDTH					cGame.SCR_WIDTH[0]
#define SCREEN_HEIGHT					cGame.SCR_HEIGHT[0]

// Template Handler
#define SET_BOUND(bound, type, index)	bounds[bound] = (short)(((type & 0xFF) << 8) | (index & 0xFF))
#define MAKE_SHORT_ID(type, index)		((short)(((type & 0xFF) << 8) | (index & 0xFF)))

// Math
#define MIN(a,b) 						(a > b ? b : a)
#define MAX(a,b) 						(a < b ? b : a)
#define SCRW_PER(percentage)			(percentage * SCREEN_WIDTH / 100)
#define SCRH_PER(percentage)			(percentage * SCREEN_HEIGHT / 100)
#define IS_EVEN(num) 					(((num & 0x000001) == 0 ? true : false))
#define ABS(x)							java.lang.Math.abs(x)

// Graphics
#define GET_ALPHA(color)				((color >> 24) & 0xFF)
#define GET_RED(color)					((color >> 16) & 0xFF)
#define GET_GREEN(color)				((color >> 8) & 0xFF)
#define GET_BLUE(color)					(color & 0xFF)
#define FADE_IN(color, level)			(color - ((level * 7) << 24))

#endif //__DEFINES_H
